home *** CD-ROM | disk | FTP | other *** search
Wrap
on ShowSite whichSite, whichTransID, whichSound global cCurrentView, cPanView, myCast, gFightMode, cView.Left, cView.Top, cView.Right, cView.Bottom, gCurrentRegions, gNewSiteSound, gSpecialFrameLast, cDragSprite, cMaxRegions, cPanFirstRegion, cLayerSoundSprite, gMixSound, gLastSound set whichSite to CheckAltSites(whichSite) set gCurrentSite to whichSite set baseSite to GetBaseSite(whichSite) if whichTransID < 0 then set thisCast to getaProp(myCast, baseSite) set the castNum of sprite cPanView to thisCast MakeRegions(whichSite, whichTransID, "P") PanView(whichTransID) ClearPanSites() set whichTransID to 0 end if set thisCast to getaProp(myCast, baseSite) set the castNum of sprite cCurrentView to thisCast MakeRegions(whichSite, whichTransID, "N") if whichTransID > 0 then puppetTransition(integer(whichTransID), 0, 16, 1) end if UpdateEnv() updateStage() if the freeBytes < (500 * 1024) then unLoadCast(801, 999) end if if whichTransID = 23 then if not gFightMode then unLoadCast() end if end if end on ProcessRegion whichSprite global gCurrentRegions, gCurrentEnv, cMaxRegions, gCurrentSite, myCast, cBackSoundSprite, gNewSiteSound, cSiteFirstRegion, cLayerSoundSprite, cEnvType, gCurrentDrag, cDragSprite, cHUDSprite, cArmSprite, gInvArmState, gMixSound, gLastSound spriteBox(cDragSprite, 0, 500, 1, 501) updateStage() set RegionIndex to whichSprite - cSiteFirstRegion + 1 set myScript to "NONE" if item 12 of line RegionIndex of gCurrentRegions <> EMPTY then set myScript to item 12 of line RegionIndex of gCurrentRegions set myCharCount to the number of chars in myScript set thisScriptType to char myCharCount - 1 to myCharCount of myScript delete char myCharCount - 1 to myCharCount of myScript if thisScriptType = "_B" then do(myScript) end if end if if item 2 of line RegionIndex of gCurrentRegions = "M" then repeat with thisEnv = 1 to the number of lines in gCurrentEnv if gCurrentSite = item 1 of line thisEnv of gCurrentEnv then if item 2 of line thisEnv of gCurrentEnv = "OB" then set thisObject to item 4 of line thisEnv of gCurrentEnv set lastSprite to the number of lines in gCurrentRegions + cSiteFirstRegion - 1 repeat with thisSprite = cSiteFirstRegion to lastSprite if item 7 of line thisSprite + 1 - cSiteFirstRegion of gCurrentRegions = thisObject then if CheckState(thisObject) = item 3 of line thisEnv of gCurrentEnv then exit repeat end if SetState(thisObject, item 3 of line thisEnv of gCurrentEnv) set thisGraphic to thisObject & "_" & GetBaseSite(gCurrentSite) & "_" & CheckState(thisObject) set thisTrans to integer(item 5 of line thisEnv of gCurrentEnv) set thisSound to item 6 of line thisEnv of gCurrentEnv set thisCast to getAt(myCast, findPos(myCast, thisGraphic)) set the castNum of sprite thisSprite to thisCast if thisSound <> EMPTY then myPlaySound(thisSound) end if puppetTransition(thisTrans, 0, 16, 1) updateStage() exit repeat end if end repeat end if end if end repeat set gCurrentSite to item 7 of line RegionIndex of gCurrentRegions set gNewSiteSound to item 11 of line RegionIndex of gCurrentRegions if gNewSiteSound <> EMPTY then myPlaySound(gNewSiteSound) end if if thisScriptType = "_M" then do(myScript) end if ShowSite(gCurrentSite, item 10 of line RegionIndex of gCurrentRegions) if thisScriptType = "_A" then do(myScript) end if exit end if if item 2 of line RegionIndex of gCurrentRegions = "S" then set thisObject to item 7 of line RegionIndex of gCurrentRegions set dragObjRequired to item 8 of line RegionIndex of gCurrentRegions set checkDragItem to GetBaseItem(gCurrentDrag) if dragObjRequired <> EMPTY then if dragObjRequired <> checkDragItem then exit end if end if ChangeState(thisObject) set gNewSiteSound to item 11 of line RegionIndex of gCurrentRegions if gNewSiteSound <> EMPTY then myPlaySound(gNewSiteSound) end if if thisScriptType = "_M" then do(myScript) end if ShowSite(gCurrentSite, item 10 of line RegionIndex of gCurrentRegions, item 11 of line RegionIndex of gCurrentRegions) if thisScriptType = "_A" then do(myScript) end if exit end if if item 2 of line RegionIndex of gCurrentRegions = "DS" then set thisObject to item 7 of line RegionIndex of gCurrentRegions set thisDragCast to thisObject & "-WD" set gNewSiteSound to item 11 of line RegionIndex of gCurrentRegions if gNewSiteSound <> EMPTY then myPlaySound(gNewSiteSound) end if if the doubleClick then ChangeState(thisObject) puppetSprite(cDragSprite, 1) set thisCast to getAt(myCast, findPos(myCast, thisDragCast)) set the castNum of sprite cDragSprite to thisCast set the ink of sprite cDragSprite to 36 set the rect of sprite cDragSprite to the rect of cast thisDragCast set the locH of sprite cDragSprite to the mouseH set the locV of sprite cDragSprite to the mouseV slideSprite(cDragSprite, 320, 420) AddToInv(thisObject) else set originalH to the mouseH set originalV to the mouseV puppetSprite(cDragSprite, 1) set thisCast to getAt(myCast, findPos(myCast, thisDragCast)) set the castNum of sprite cDragSprite to thisCast set the ink of sprite cDragSprite to 36 set the rect of sprite cDragSprite to the rect of cast thisDragCast set the locH of sprite cDragSprite to the mouseH set the locV of sprite cDragSprite to the mouseV updateStage() repeat while the mouseDown set the locH of sprite cDragSprite to the mouseH set the locV of sprite cDragSprite to the mouseV updateStage() end repeat if sprite cDragSprite intersects cHUDSprite then ChangeState(thisObject) AddToInv(thisObject) if gInvArmState = 1 then ShowInvArm() end if else slideSprite(cDragSprite, originalH, originalV) end if end if spriteBox(cDragSprite, 0, 500, 1, 501) updateStage() if thisScriptType = "_M" then do(myScript) end if ShowSite(gCurrentSite, item 10 of line RegionIndex of gCurrentRegions, item 11 of line RegionIndex of gCurrentRegions) if thisScriptType = "_A" then do(myScript) end if exit end if if item 2 of line RegionIndex of gCurrentRegions = "C" then set CardName to item 7 of line RegionIndex of gCurrentRegions doCardMode(CardName) if thisScriptType = "_A" then do(myScript) end if exit end if if item 2 of line RegionIndex of gCurrentRegions = "Z" then set thisFrame to item 7 of line RegionIndex of gCurrentRegions ShowSite(gCurrentSite, 0, EMPTY) go(thisFrame) if thisScriptType = "_A" then do(myScript) end if exit end if if item 2 of line RegionIndex of gCurrentRegions = "B" then if thisScriptType = "_A" then do(myScript) end if exit end if end on PanView whichTransID global gCurrentRegions, gPanRegions, cPanView, cCurrentView, cMaxRegions, cSiteFirstRegion, cPanFirstRegion set thePanCount to 4 if whichTransID = "-2" then set theHorizontalShift to -640 set thePanSize to 160 else set theHorizontalShift to 640 set thePanSize to -160 end if set cView.Left to 0 set cView.Top to 0 set cView.Right to 640 set cView.Bottom to 390 spriteBox(cPanView, cView.Left + theHorizontalShift, cView.Top, cView.Right + theHorizontalShift, cView.Bottom) set PanCount to the number of lines in gPanRegions set RegionCount to the number of lines in gCurrentRegions repeat with SpriteCount = 1 to RegionCount set whichSprite to SpriteCount + cSiteFirstRegion - 1 end repeat repeat with count = 1 to thePanCount set the locH of sprite cCurrentView to the locH of sprite cCurrentView + thePanSize set the locH of sprite cPanView to the locH of sprite cPanView + thePanSize repeat with SpriteCount = 1 to RegionCount set whichSprite to SpriteCount + cSiteFirstRegion - 1 spriteBox(whichSprite, the left of sprite whichSprite + thePanSize, the top of sprite whichSprite, the right of sprite whichSprite + thePanSize, the bottom of sprite whichSprite) end repeat repeat with SpriteCount = 1 to PanCount set whichSprite to SpriteCount + cPanFirstRegion - 1 set the locH of sprite whichSprite to the locH of sprite whichSprite + thePanSize end repeat updateStage() end repeat end on MakeRegions whichSite, whichTransID, makeType global gPanRegions, gClickRegionIndex, gClickRegions, gCurrentRegions, cMaxRegions, cSiteFirstRegion, cPanFirstRegion, cRegionInk, cRegionCast, gNeutralCursor, gCurrentSite, gCurrentEnv, gRobotSprite, gFightMode, gRobotAlive, gRobotPathIndex set myRegions to GetRegions(whichSite) set RegionCount to the number of lines in myRegions if makeType = "N" then set gCurrentRegions to myRegions set myFirstSprite to cSiteFirstRegion else repeat with thisRegion = 1 to RegionCount if thisRegion > the number of lines in myRegions then exit repeat end if if item 2 of line thisRegion of myRegions = "M" then if item 8 of line thisRegion of myRegions = EMPTY then delete line thisRegion of myRegions set thisRegion to thisRegion - 1 end if end if end repeat set gPanRegions to myRegions set myFirstSprite to cPanFirstRegion end if if whichTransID < 0 then if whichTransID = "-2" then set theHorizontalShift to -640 else set theHorizontalShift to 640 end if else set theHorizontalShift to 0 end if if gCurrentRegions = EMPTY then exit end if set gFightMode to 0 repeat with count = 1 to cMaxRegions if count <= RegionCount then if (item 2 of line count of myRegions = "F") and (makeType = "N") then if gRobotAlive then set gFightMode to 1 set thisSprite to count + myFirstSprite - 1 set gRobotSprite to thisSprite else set thisSprite to count + myFirstSprite - 1 set the backColor of sprite gRobotSprite to 0 spriteBox(thisSprite, 0, 500, 1, 501) end if end if if (item 2 of line count of myRegions = "FB") and (makeType = "N") and gRobotAlive then set thisSprite to count + myFirstSprite - 1 set thisObject to item 7 of line count of myRegions set temp.left to integer(item 3 of line count of myRegions) + theHorizontalShift set temp.top to integer(item 4 of line count of myRegions) set temp.right to integer(item 5 of line count of myRegions) + theHorizontalShift set temp.bottom to integer(item 6 of line count of myRegions) set thisCast to getAt(myCast, findPos(myCast, thisObject)) set the castNum of sprite thisSprite to thisCast spriteBox(thisSprite, temp.left, temp.top, temp.right, temp.bottom) set the ink of sprite thisSprite to 8 end if if item 2 of line count of myRegions = "M" then set thisSprite to count + myFirstSprite - 1 set temp.left to integer(item 3 of line count of myRegions) + theHorizontalShift set temp.top to integer(item 4 of line count of myRegions) set temp.right to integer(item 5 of line count of myRegions) + theHorizontalShift set temp.bottom to integer(item 6 of line count of myRegions) if item 8 of line count of myRegions = EMPTY then set the ink of sprite thisSprite to cRegionInk set the castNum of sprite thisSprite to cRegionCast else set thisGraphic to item 8 of line count of myRegions set thisCast to getaProp(myCast, thisGraphic) set the castNum of sprite thisSprite to thisCast set the ink of sprite thisSprite to 8 end if spriteBox(thisSprite, temp.left, temp.top, temp.right, temp.bottom) set thisCast to item 9 of line count of myRegions set whichCursor to getaProp(myCast, thisCast) set thisCast to thisCast & "_Mask" set whichCursorMask to getaProp(myCast, thisCast) set whichCursor to [whichCursor, whichCursorMask] set the cursor of sprite thisSprite to whichCursor end if if item 2 of line count of myRegions = "S" then set thisSprite to count + myFirstSprite - 1 set thisObject to item 7 of line count of myRegions put "_" & GetBaseSite(whichSite) & "_" & CheckState(thisObject) after thisObject set temp.left to integer(item 3 of line count of myRegions) + theHorizontalShift set temp.top to integer(item 4 of line count of myRegions) set temp.right to integer(item 5 of line count of myRegions) + theHorizontalShift set temp.bottom to integer(item 6 of line count of myRegions) set thisCast to getaProp(myCast, thisObject) set the castNum of sprite thisSprite to thisCast spriteBox(thisSprite, temp.left, temp.top, temp.right, temp.bottom) set the ink of sprite thisSprite to 8 set thisCast to item 9 of line count of myRegions set whichCursor to getaProp(myCast, thisCast) set thisCast to thisCast & "_Mask" set whichCursorMask to getaProp(myCast, thisCast) set whichCursor to [whichCursor, whichCursorMask] set the cursor of sprite thisSprite to whichCursor end if if item 2 of line count of myRegions = "DS" then set thisSprite to count + myFirstSprite - 1 set thisObject to item 7 of line count of myRegions put "_" & GetBaseSite(whichSite) & "_" & CheckState(thisObject) after thisObject set temp.left to integer(item 3 of line count of myRegions) + theHorizontalShift set temp.top to integer(item 4 of line count of myRegions) set temp.right to integer(item 5 of line count of myRegions) + theHorizontalShift set temp.bottom to integer(item 6 of line count of myRegions) set thisCast to getaProp(myCast, thisObject) set the castNum of sprite thisSprite to thisCast spriteBox(thisSprite, temp.left, temp.top, temp.right, temp.bottom) set the ink of sprite thisSprite to 8 set thisCast to item 9 of line count of myRegions set whichCursor to getaProp(myCast, thisCast) set thisCast to thisCast & "_Mask" set whichCursorMask to getaProp(myCast, thisCast) set whichCursor to [whichCursor, whichCursorMask] set the cursor of sprite thisSprite to whichCursor end if if item 2 of line count of myRegions = "B" then set thisSprite to count + myFirstSprite - 1 set thisObject to item 7 of line count of myRegions set temp.left to integer(item 3 of line count of myRegions) + theHorizontalShift set temp.top to integer(item 4 of line count of myRegions) set temp.right to integer(item 5 of line count of myRegions) + theHorizontalShift set temp.bottom to integer(item 6 of line count of myRegions) set thisCast to getaProp(myCast, thisObject) set the castNum of sprite thisSprite to thisCast spriteBox(thisSprite, temp.left, temp.top, temp.right, temp.bottom) set the ink of sprite thisSprite to 8 set thisCast to item 9 of line count of myRegions set whichCursor to getaProp(myCast, thisCast) set thisCast to thisCast & "_Mask" set whichCursorMask to getaProp(myCast, thisCast) set whichCursor to [whichCursor, whichCursorMask] set the cursor of sprite thisSprite to whichCursor end if if (item 2 of line count of myRegions = "C") and (makeType = "N") then set thisSprite to count + myFirstSprite - 1 set thisObject to item 7 of line count of myRegions set temp.left to integer(item 3 of line count of myRegions) + theHorizontalShift set temp.top to integer(item 4 of line count of myRegions) set temp.right to integer(item 5 of line count of myRegions) + theHorizontalShift set temp.bottom to integer(item 6 of line count of myRegions) set the ink of sprite thisSprite to cRegionInk set the castNum of sprite thisSprite to cRegionCast spriteBox(thisSprite, temp.left, temp.top, temp.right, temp.bottom) set thisCast to item 9 of line count of myRegions set whichCursor to getaProp(myCast, thisCast) set thisCast to thisCast & "_Mask" set whichCursorMask to getaProp(myCast, thisCast) set whichCursor to [whichCursor, whichCursorMask] set the cursor of sprite thisSprite to whichCursor end if if (item 2 of line count of myRegions = "Z") and (makeType = "N") then set thisSprite to count + myFirstSprite - 1 set temp.left to integer(item 3 of line count of myRegions) + theHorizontalShift set temp.top to integer(item 4 of line count of myRegions) set temp.right to integer(item 5 of line count of myRegions) + theHorizontalShift set temp.bottom to integer(item 6 of line count of myRegions) set the ink of sprite thisSprite to cRegionInk set the castNum of sprite thisSprite to cRegionCast spriteBox(thisSprite, temp.left, temp.top, temp.right, temp.bottom) set thisCast to item 9 of line count of myRegions set whichCursor to getaProp(myCast, thisCast) set thisCast to thisCast & "_Mask" set whichCursorMask to getaProp(myCast, thisCast) set whichCursor to [whichCursor, whichCursorMask] set the cursor of sprite thisSprite to whichCursor end if next repeat end if set thisSprite to count + myFirstSprite - 1 set the backColor of sprite gRobotSprite to 0 spriteBox(thisSprite, 0, 500, 1, 501) end repeat set gCurrentEnv to GetEnviro(gCurrentSite) if gFightMode and gRobotAlive then set the backColor of sprite gRobotSprite to 255 set the ink of sprite gRobotSprite to 36 repeat with count = 1 to cMaxRegions set thisSprite to count + myFirstSprite - 1 set the cursor of sprite thisSprite to 0 end repeat end if end